query

@NonNull
open fun query(@NonNull uri: @NonNull Uri, projection: @Nullable Array<String>, @Nullable selection: @Nullable String, selectionArgs: @Nullable Array<String>, @Nullable sortOrder: @Nullable String): @NonNull Cursor(source)

Use a content URI returned by getUriForFile() to get information about a file managed by the FileProvider. FileProvider reports the column names defined in OpenableColumns:

For more information, see ContentProvider.query().

Return

A Cursor containing the results of the query.

Parameters

uri

A content URI returned by getUriForFile.

projection

The list of columns to put into the Cursor. If null all columns are included.

selection

Selection criteria to apply. If null then all data that matches the content URI is returned.

selectionArgs

An array of String, containing arguments to bind to the selection parameter. The query method scans selection from left to right and iterates through selectionArgs, replacing the current "?" character in selection with the value at the current position in selectionArgs. The values are bound to selection as String values.

sortOrder

A String containing the column name(s) on which to sort the resulting Cursor.